package com.bjpowernode.services;
import com.bjpowernode.beans.User;
import com.bjpowernode.mapper.UserMapper;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service("userServices")
public class UserServicesImp implements UserServices {
    @Autowired
    UserMapper userMapper;

    @Override
    public User login(String loginAct, String loginPwd) {
        loginPwd = DigestUtils.md5Hex(loginPwd);
        return userMapper.getByUser(loginAct, loginPwd);
    }

    @Override
    public ArrayList<User> getAll() {
        return userMapper.getAll();
    }
}
